#include "kmp.h"
int usage(const char *appName)
{
    printf("Usage: %s <string> <key>\n", appName);
    return 1;
}
int main(int argc, const char *argv[])
{
    int *nextLoc = NULL;
    if (argc == 1)
        return usage(*argv);

    nextLoc = nextLocs(argv[1]);

#ifdef NEXTLOC_TEST
    for (int i = 0; i < strlen(argv[1]); i++)
    {
        printf("%d ", nextLoc[i]);
    }
    printf("\n");
#endif
#ifdef KMP
    if (argc < 3)
    {
        return usage(*argv);
    }
    RESULT res = contain(argv[1], argv[2]);
    printf("res:%d\n", res);
#endif
#ifdef DYNAMIC
    free(nextLoc);
#endif
    return 0;
}
